unit UControleDisponibilidade;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, Mask, ToolEdit, RXDBCtrl, DBCtrls,
  QuickRpt, QRCtrls, Grids, DBGrids, DB, DBTables;

type
  TFrmControleDisponibilidade = class(TForm)
    Panel1: TPanel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    BitBtn4: TBitBtn;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    dblGrupoBanco: TDBLookupComboBox;
    Label3: TLabel;
    dblBanco: TDBLookupComboBox;
    Label2: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Bevel1: TBevel;
    qryLancamento: TQuery;
    DBGrid1: TDBGrid;
    Label6: TLabel;
    nreg: TLabel;
    rxdeFim: TDateEdit;
    rxdeIni: TDateEdit;
    dsLancamento: TDataSource;
    QuickRep1: TQuickRep;
    Cabecalho: TQRGroup;
    DetailBand1: TQRBand;
    RodaPe: TQRBand;
    PageHeaderBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRSysData1: TQRSysData;
    QRLabel2: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel8: TQRLabel;
    QRDBText1: TQRDBText;
    QRDBText2: TQRDBText;
    QRDBText3: TQRDBText;
    QRDBText4: TQRDBText;
    QRDBText5: TQRDBText;
    QRDBText6: TQRDBText;
    QRExpr1: TQRExpr;
    QRExpr2: TQRExpr;
    QRExpr3: TQRExpr;
    QRExpr4: TQRExpr;
    QRLabel9: TQRLabel;
    QRLabel10: TQRLabel;
    QRLabel11: TQRLabel;
    QRLabel12: TQRLabel;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FrmControleDisponibilidade: TFrmControleDisponibilidade;

implementation

uses UGeral;
  

{$R *.dfm}

procedure TFrmControleDisponibilidade.BitBtn1Click(Sender: TObject);
begin
  if (rxdeIni.Date = 0) or (rxdeFim.Date = 0) then
  begin
    alert('As datas: Inicial e Final devem ser Informadas!');
    exit;
  end;  

end;

procedure TFrmControleDisponibilidade.BitBtn3Click(Sender: TObject);
begin
   quickrep1.preview;
end;

procedure TFrmControleDisponibilidade.BitBtn4Click(Sender: TObject);
begin
  close;
  FrmControleDisponibilidade := nil;
end;

procedure TFrmControleDisponibilidade.BitBtn2Click(Sender: TObject);
begin
  dblGrupoBanco.ListFieldIndex := 0;
  dblBanco.ListFieldIndex := 0;
  rxdeIni.Date := 0;
  rxdeFim.Date := 0;
  qryLancamento.Close;
  nreg.Caption := '0';
end;

procedure TFrmControleDisponibilidade.FormShow(Sender: TObject);
begin
  with FrmControleDisponibilidade do
  begin
        HorzScrollBar.Visible := false;
        VertScrollBar.Visible := False;
        Width := Panel1.Width + 4;
        Height := QuickRep1.Top;
        nreg.Caption := '0';
  end;
end;

end.
